package com.cqc.web;

import com.cqc.entity.UserEB;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.Date;


@RequestMapping("/user/")
@Controller
public class UserController {

//$.post('http://localhost:8080/spring_cors_demo/user/getUser.do',function(data){
//        console.log('success',data)
//    })
    /**
     * http://localhost:8080/spring_cors_demo/user/getUser.do
     */
    @RequestMapping("getUser")
    @ResponseBody
    public UserEB getUser() {
        UserEB eb = new UserEB();
        eb.setId(1);
        eb.setUsername("克林顿");
        eb.setBirthday(new Date());
        eb.setSex("1");
        eb.setAddress("美国");
        return eb;
    }

}
